/*
 * xor.c
 *
 *  Created on: May 27, 2025
 *      Author: lsy18
 */

#include <stdint.h>

uint8_t xor_create(uint8_t *data , uint8_t length)
{
	uint8_t xor_val = 0;
	for (uint8_t i = 0; i < length-1; i++)
	{
		xor_val ^= data[i];
	}
	return xor_val;
}

uint8_t xor_exam (uint8_t *data , uint8_t length)
{
	return data[length-1] == xor_create(data , length);
}
